import 'dart:convert';
import 'package:getx_demo_2/generated/json/base/json_field.dart';
import 'package:getx_demo_2/generated/json/test_entity_entity.g.dart';

@JsonSerializable()
class TestEntityEntity {
  late TestEntityData data;
  late int errorCode;
  late String errorMsg;

  TestEntityEntity();

  factory TestEntityEntity.fromJson(Map<String, dynamic> json) =>
      $TestEntityEntityFromJson(json);

  Map<String, dynamic> toJson() => $TestEntityEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class TestEntityData {
  int? curPage;
  List<TestEntityDataDatas>? datas;
  int? offset;
  bool? over;
  int? pageCount;
  int? size;
  int? total;

  TestEntityData();

  factory TestEntityData.fromJson(Map<String, dynamic> json) =>
      $TestEntityDataFromJson(json);

  Map<String, dynamic> toJson() => $TestEntityDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class TestEntityDataDatas {
  late String apkLink;
  late int audit;
  late String author;
  late bool canEdit;
  late int chapterId;
  late String chapterName;
  late bool collect;
  late int courseId;
  late String desc;
  late String descMd;
  late String envelopePic;
  late bool fresh;
  late String host;
  late int id;
  late String link;
  late String niceDate;
  late String niceShareDate;
  late String origin;
  late String prefix;
  late String projectLink;
  late int publishTime;
  late int realSuperChapterId;
  late int selfVisible;
  late int shareDate;
  late String shareUser;
  late int superChapterId;
  late String superChapterName;
  late List<TestEntityDataDatasTags> tags;
  late String title;
  late int type;
  late int userId;
  late int visible;
  late int zan;

  TestEntityDataDatas();

  factory TestEntityDataDatas.fromJson(Map<String, dynamic> json) =>
      $TestEntityDataDatasFromJson(json);

  Map<String, dynamic> toJson() => $TestEntityDataDatasToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class TestEntityDataDatasTags {
  late String name;
  late String url;

  TestEntityDataDatasTags();

  factory TestEntityDataDatasTags.fromJson(Map<String, dynamic> json) =>
      $TestEntityDataDatasTagsFromJson(json);

  Map<String, dynamic> toJson() => $TestEntityDataDatasTagsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
